Irender

Section: Line (-)
Updated: Simple
Index Return to Main Contents

 6 "IRIT Version 6.0"   

NAME

Irender - Simple Scan Line Renderer

 

Introduction

irender is a program to render IRIT scenes into images. It is a software based Z buffer that is able to create images in few formats. Several of its features includes parametric and volumetric texture mapping, shadow computations, transparency and antialiasing.

Freeform objects are preprocessed into polygons with controlled fineness.

 

Command line options


  irender [-z] [-v] [-s XSize YSize] [-a Ambient] [-b R G B] [-B]
          [-F PolyOpti FineNess] [-f PolyOpti SampPerCrv]
          [-M Flat/Gouraud/Phong] [-P WMin [WMax]] [-S] [-T]
          [-A FilterName] [-Z] [-n] [-i rle/ppm] files

-z: Prints version number and current defaults. -v: Verbose mode. Prints informative messages as it progresses. -s XSize YSize: Sets the size of the output image, in pixels. Default to 512x512. -a Ambient: Sets the ambient lighting fraction. Between zero (no ambient lighting) and one. Default to 0.2. -b R G B: Sets the background color. Each of thre R,G,B colors is an integer value between zero and 255. Default to black. -B : Apply back face culling. Somewhat faster, but only correct for closed objects. Default is no back face culling. -F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. Default is 0 and 20.0 (no optimal sampling with fineness of 20.0 (real number)). -f PolyOpti SampPerCrv: Controls the method used to approximate curves into polylines. If PolyOpti == 0, equally spaced intervals are used. Otherwise, an adaptive subdivision that optimizes the samples is employed. Default is 0 64 (no optimal sampling with 64 samples). -M Flat/Gouraud/Phong: Selects the shader to be used. Default to Phong if has normals of vertices, Flat if no normals are found. -P WMin [WMax]: Width of rendered polyline, in pixels. If only WMin is specified, all polylines are set to have WMin width. Otherwise, if WMax is prescribed as well, polylines' width is set to be proportional to their depth with WMax is the width of closest polyline and WMin the farest polyline. -S: Enable shadow computation. No shadows will be rendered without -S. -T: Enable transparency computation. No transparent object will be processed without -T. -A FilterName: Selects an antialiasing filter. FilterName can be one of 'none', 'box', 'triangle', 'quadratic', 'cubic', 'catrom', -Z: Output will be in the form of Z depth instead of a color image. Output will be 32 bits depth instead of RGBA. -n: Reverses the normals of vertices and planes, globally. -i rle/ppm: Selects output image type. Currently the Utah Raster Toolkit's (URT) rle format is being supported as well as the PPM format.

Some of the options may be turned on in irender.cfg. They can be then turned off in the command line as '-?-'.

 

Configuration

The program can be configured using a configuration file named irender.cfg. This is a plain ASCII file you can edit directly and set the parameters according to the comments there. 'irender -z' will display the current configuration as read from the configuration file.

The configuration file is searched in the directory specified by the IRIT_PATH environment variable. For example, If the IRIT_PATH variable is not set, the current directory is searched.

 

Usage

As this program is not interactive, usage is quite simple, and the only control available is using the command line options.

 

Advanced Usage

One can specify several attributes that affect the way the scene is rendered. The attributes can be generated within IRIT. See also the ATTRIB IRIT command.

Surface color is controlled in two levels. If the object has an RGB attribute, it is used. Otherwise, a color as set via the IRIT COLOR command is used.

If a certain surface should be finer/caurser than the rest of the scene, one can set a "resolution" attribute which specifies the relative FineNess resolution of this specific surface. Further, "u_resolution" and "v_resolution" might be similarly used to set relative resolution for the u or v direction only.

Example:


 attrib( Ball, "rgb", "255,0,0" );
 color( Sphere, white );

The cosine exponent of the phong shader can be set for a specific object via the SRF_COSINE attribute.

Example:


 attrib( Ball, "srf_cosine", 16 );

An object can be drawn transparent instead of opaque, if it has a "transp" attribute. A transparent value of one denotes a completely transparent object, while a value of zero means a completely opaque object. Transparent object will be rendered as such if and only if the '-T' command line option is set.

Example:


 attrib( final, "transp", 0.5 );

Several types of texture mapping are supported. Parametric texture may be attached to a parametric surface where the prescribed image is mapped onto the rectangular parametric domain of the surface.

Example:


 attrib( Srf1, "ptexture", "checker.ppm" );

The program will automatically detected a ppm file from an rle according to the file's name.

A second type of texture mapping can be applied to all geometric objects. Herein, a procedural texture mapping is employed and currently only "wood" and "marble" are supported. A second parameter that must be provided for procedural textures is the scaling factor of the texture, which can be either one parameter of uniform scaling or a vector of three coefficients for scaling in x, y, and z. The two parameters are seperated by a comma.

Example:


 attrib( Obj1, "texture", "marble, 2" );
 attrib( Obj2, "texture", "wood, 1 0.5 2.5" );

which sets Obj1 to have a marble procedural texture with a uniform scaling factor of 2 and a wood texture for Obj2 with scaling factors of (1, 0.5, 2.5) in x, y, and z.

In addition, a scalar surface spanning the same parameteric domain as an original surface may be used as texture mapping function. Herein, the scalar function texture is evaluated at each UV parameter value and is mapped through a color scale to yield the output color. This type of texture is useful for stress maps or analysis maps on top of freeform surfaces. Several related attributes are supported: "stexture_scale" which prescribes the color scale image (only its first column is employed), and "stexture_bound" that sets the domain that will be clipped to the min max values. Funally, "stexture_func" can hold the functions "sqrt" or "abs" to be applied to the evaluated surface value.

Example:


 attrib( Srf, "stexture", scrvtr( Srf, P1, off ) );
 attrib( Srf, "stexture_scale", "color_scale.ppm" );
 attrib( Srf, "stexture_func", "sqrt" );
 attrib( Srf, "stexture_bound", "0.0 100.0" );

where scrvtr computes a scalar field to Srf that represents the sum of the squares of the principle curvatures. The evaluated scalar texture surface's value is piped through a sqrt function. The first column of the image of color_scale.ppm is used to set the coloring scale for curvature bounds values between 0.0 and 100.0.

Both "stexture_scale" and "stexture_bound" are optional. The default color scale maps the min/max values from blue to red through green. The default scalar surface texture bound is computed as the extreme values of the "stexture" surface.

While the program has a default for lighting which is two light sources at opposite directions at (1, 1, 1) and (-1, -1, -1), one can overwrite this default. A POINT_TYPE object with LIGHT_SOURCE attribute denotes a light source. If irender detects one or more light sources in the input stream, the default light sources are not created. Two types of light sources may be prescribed, a parallel at infinity or a point at finite distance light source, distinguished by a TYPE attribute of either POINT_POS or POINT_INFTY. A point light source can be colored, when an RGB attribute will set its color. A point light source will cast shadows if and only if it has SHADOW attribute (one needs to apply the '-S' command line option as well for rendering shadows). Finally, one can construct two mirrored light sources at opposite directions if TWOLIGHT attribute is added to the light source object.

Example:


    Light1 = point( 0, 0, 10 );
    attrib( Light1, "light_source", on );
    attrib( Light1, "shadow", on );
    attrib( Light1, "rgb", "255,0,0" );
    attrib( Light1, "type", "point_pos" );


    Light2 = point( 1, 1, 1 );
    attrib( Light2, "light_source", on );
    attrib( Light2, "twolight", on );
    attrib( Light2, "type", "point_infty" );

constructs two lights sources with Light1 with red color positioned at (0, 0, 10) and casting shadows, while Light2 will create two mirrored white parallel lights sources in the direction of (1, 1, 1) and (-1, -1, -1), as is irender's default.


 

Index

NAME
Introduction
Command line options
Configuration
Usage
Advanced Usage

This document was created by man2html, using the manual pages.
Time: 07:27:19 GMT, October 17, 2022